home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Software Contest 3
/
FM Towns Software Contest 3.iso
/
exp
/
astral
/
a1
/
game
/
source
/
sprsub.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-01-07
|
2KB
|
80 lines
#include <spr.h>
#include "scmds.h"
void put_count(int w)
{
SPR_set_att(896+123,1,1,(128+2+(w/10000)),0x8100);
w%=10000;
SPR_set_att(896+124,1,1,(128+2+(w/1000)),0x8100);
w%=1000;
SPR_set_att(896+125,1,1,(128+2+(w/100)),0x8100);
w%=100;
SPR_set_att(896+126,1,1,(128+2+(w/10)),0x8100);
w%=10;
SPR_set_att(896+127,1,1,(128+2+(w)),0x8100);
}
void put_score(int w)
{
SPR_set_att(896+112,1,1,(128+2+(w/100000000)),0x8100);
w%=10000000;
SPR_set_att(896+113,1,1,(128+2+(w/1000000)),0x8100);
w%=1000000;
SPR_set_att(896+114,1,1,(128+2+(w/100000)),0x8100);
w%=100000;
SPR_set_att(896+115,1,1,(128+2+(w/10000)),0x8100);
w%=10000;
SPR_set_att(896+116,1,1,(128+2+(w/1000)),0x8100);
w%=1000;
SPR_set_att(896+117,1,1,(128+2+(w/100)),0x8100);
}
void putstrg(int x,int y,int spr_num,char *str,int num)
{
int i;
for(i=0;i<num;i++){
if(str[i]>='A' && str[i]<='Z'){
SPR_set_att_pos(spr_num+i,1,1,128+14+(str[i]-'A'),0x8100,x+i*8,y);
continue;
}
if(str[i]=='!'){
SPR_set_att_pos(spr_num+i,1,1,128+14+26,0x8100,x+i*8,y);
continue;
}
if(str[i]==':'){
SPR_set_att_pos(spr_num+i,1,1,128+14+27,0x8100,x+i*8,y);
continue;
}
if(str[i]==','){
SPR_set_att_pos(spr_num+i,1,1,128+14+28,0x8100,x+i*8,y);
continue;
}
if(str[i]=='\''){
SPR_set_att_pos(spr_num+i,1,1,128+14+29,0x8100,x+i*8,y);
continue;
}
if(str[i]=='.'){
SPR_set_att_pos(spr_num+i,1,1,128+14+30,0x8100,x+i*8,y);
continue;
}
if(str[i]=='>'){
SPR_set_att_pos(spr_num+i,1,1,128+14+31,0x8100,x+i*8,y);
continue;
}
else{
SPR_set_att(spr_num+i,1,1,0,0x2000);
continue;
}
}
}
void put_shield(int shield)
{
int i;
for(i=shield;i<4;i++){
SPR_set_att(896+98+i,1,1,0,0x2000);
}
}